-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.3] SEF: Fix URLs when preprocessing #43992
Conversation
I have tested this item 🔴 unsuccessfully on da8002a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43992. |
As this PR is against 5.2, you have to also test this on 5.2-dev and not 5.1. |
When you link the category of the article in a menu item, you should have successfull tests. |
Since we are in feature freeze, I'm going to change the target of this PR to 5.3-dev. |
@Hackwar Can I use 5.2beta1 or do I need a nightly build? |
@Hackwar ??? |
@Hackwar System tests are failing:
|
@dautrich beta1 should be enough. @richard67 I'm aware. The tests are broken, since they are saving the contact with a broken catid. |
…2-router-cleanuprule
I have tested this item ✅ successfully on c57d285 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43992. Tested on naked 5.2.0-beta1, local with Laragon. |
Co-authored-by: Brian Teeman <brian@teeman.net>
When applying this PR using the patch tester component, the Link to the article as well as its URL changes from SEF Plugin, Strict Routing: No SEF Plugin, Strict Routing: Yes Joomla v5.2.0-beta3 |
I have tested this item ✅ successfully on 894383e This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43992. |
I have tested this item ✅ successfully on 894383e This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43992. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43992. |
Thanks to all who have worked on this PR. |
Summary of Changes
The routing in Joomla requires some information to be in the query to build proper URLs. One is the
slug
, the combination of the ID and alias of a content item (for example&id=42:the-answer-to-everything
) and the other is the parent key, if the extension requires this. (for example&catid=21
) When this information is missing, the router can't build the right URL.This PR adds a new component router rule, which should help fixing such URLs. The rule is supposed to be flexible enough to be used by most third party components. The parameters for the rule are the view configuration to act upon, the table to read the info from, the tables key and the tables parent key. The parent key is optional and the rule can be added more than once for different views.
Testing Instructions
index.php?option=com_content&view=article&id=<id>
whereid
is the ID of the article which is NOT directly linked to by a menu item.Actual result BEFORE applying this Pull Request
You get a strange link, for example something like
/menuitem?view=article&id=42
Expected result AFTER applying this Pull Request
You get the correct link, for example
/menuitem/this-test-is-successfull
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed